package cn.yunxiang.summer.system.domain.bo;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import cn.yunxiang.summer.system.domain.SysVersion;

@Data
public class SysVersionBo {

    @Schema(description = "平台类型（ios/android）")
    private String platformType;

    @Schema(description = "版本号")
    private String versionCode;

    @Schema(description = "版本名称")
    private String versionName;

    @Schema(description = "状态")
    private Integer status;


    public Wrapper<SysVersion> toWrapper() {
        return new LambdaQueryWrapper<SysVersion>()
            .eq(platformType != null, SysVersion::getPlatformType, platformType)
            .eq(versionCode != null, SysVersion::getVersionCode, versionCode)
            .eq(versionName != null, SysVersion::getVersionName, versionName)
            .eq(status != null, SysVersion::getStatus, status);
    }
}
